﻿using System;
using System.Data;
using Model;
using DBUtility;

namespace DAL
{
     /// <summary>
     /// 数据访问层VEHICLE_DISPATCH_DAL
     /// </summary>
     public class VEHICLE_DISPATCH_DAL
     {
         public VEHICLE_DISPATCH_DAL()
         {
         }


         /// <summary>
         /// 得到最大JCLSH
         /// </summary>
         public string GetMax_JCLSH(string p_strWhere)
         {
             string strResult = "0";
             string strSql = "select max(JCLSH) as m from VEHICLE_DISPATCH";

             if(p_strWhere.Trim().Length > 0)
             {
                 strSql += " where " + p_strWhere;
             }

             DataTable dtTemp = new DataTable();
             DbHelper.GetTable(strSql, ref dtTemp);

             if(dtTemp.Rows.Count>0)
             {
                 if(dtTemp.Rows[0]["m"].ToString().Length>0)
                 {
                     strResult = dtTemp.Rows[0]["m"] == DBNull.Value ? "" : dtTemp.Rows[0]["m"].ToString();
                 }
             }

             dtTemp.Dispose();

             return string.Format("{0:D50}", Convert.ToInt32(strResult) + 1);

          }

          /// <summary>
          /// 得到最大JCLSH
          /// </summary>
          public string GetMax_JCLSH()
          {
              return GetMax_JCLSH("");
          }


          /// <summary>
          /// 判断数据是否存在
          /// </summary>
          public bool Exists(string strJCLSH)
          {
               bool bolResult = false;

               if (strJCLSH == null)
               {
                   return false;
               }

               if (strJCLSH.Length == 0)
               {
                   return false;
               }

               string strSql = "";
               strSql += "select count(1) as c from VEHICLE_DISPATCH";
               strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

               DataTable dtTemp = new DataTable();
               DbHelper.GetTable(strSql, ref dtTemp);

               if (dtTemp.Rows.Count > 0)
               {
                   bolResult = Convert.ToInt32(dtTemp.Rows[0]["c"]) > 0;
               }

               dtTemp.Dispose();

               return bolResult;

          }

          /// <summary>
          /// 获取数据总记录数
          /// </summary>
          public int GetRecordCount(string p_strWhere)
          {
              int intResult=0;

              string strSql = "";
              strSql += "select count(1) as c from VEHICLE_DISPATCH";
              if(p_strWhere.Trim().Length > 0)
              {
                 strSql += " where " + p_strWhere;
              }

              DataTable dtTemp = new DataTable();
              DbHelper.GetTable(strSql, ref dtTemp);

              if(dtTemp.Rows.Count>0)
              {
                  intResult=Convert.ToInt32(dtTemp.Rows[0]["c"]);
              }

              dtTemp.Dispose();

              return intResult;
          }

          /// <summary>
          /// 获取数据总记录数
          /// </summary>
          public int GetRecordCount()
          {
              return GetRecordCount("");
          }

          /// <summary>
          /// 获取数据分页总数
           /// </summary>
          public int GetPageCount(string p_strWhere, int p_intPageSize)
          {
              int intResult=0;

              if(p_intPageSize > 0)
              {
                  int intRecordCount = GetRecordCount(p_strWhere);
                  intResult = Convert.ToInt32(Math.Truncate(Convert.ToDecimal(intRecordCount) / Convert.ToDecimal(p_intPageSize)));
                  if (intRecordCount > (intResult * p_intPageSize))
                  {
                       intResult++;
                  }
              }

              if(intResult == 0)
              {
                   intResult++;
              }
              return intResult;
           }

          /// <summary>
          /// 获取数据分页总数
          /// </summary>
          public int GetPageCount(int p_intPageSize)
          {
              return GetPageCount("", p_intPageSize);
          }

          /// <summary>
          /// 添加一条数据 SQL
          /// </summary>
          public string InsertSQL(VEHICLE_DISPATCH model)
          {
              string strFieldSQL = "";
              string strValueSQL = "";

              if(model.Changed("VEHICLEID") == true && model.VEHICLEID != null)
              {
                   strFieldSQL += ",VEHICLEID";
                   strValueSQL += ",'" + model.VEHICLEID.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JCXH") == true && model.JCXH != null)
              {
                   strFieldSQL += ",JCXH";
                   strValueSQL += "," + model.JCXH + "";
              }

              if(model.Changed("JCXHMS") == true && model.JCXHMS != null)
              {
                   strFieldSQL += ",JCXHMS";
                   strValueSQL += ",'" + model.JCXHMS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCJCXH") == true && model.SCJCXH != null)
              {
                   strFieldSQL += ",SCJCXH";
                   strValueSQL += "," + model.SCJCXH + "";
              }

              if(model.Changed("JCZT_STATUS") == true && model.JCZT_STATUS != null)
              {
                   strFieldSQL += ",JCZT_STATUS";
                   strValueSQL += "," + model.JCZT_STATUS + "";
              }

              if(model.Changed("GW_STATUS") == true && model.GW_STATUS != null)
              {
                   strFieldSQL += ",GW_STATUS";
                   strValueSQL += "," + model.GW_STATUS + "";
              }

              if(model.Changed("GWBH") == true && model.GWBH != null)
              {
                   strFieldSQL += ",GWBH";
                   strValueSQL += "," + model.GWBH + "";
              }

              if(model.Changed("YJGWH") == true && model.YJGWH != null)
              {
                   strFieldSQL += ",YJGWH";
                   strValueSQL += ",'" + model.YJGWH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZDGWBH") == true && model.ZDGWBH != null)
              {
                   strFieldSQL += ",ZDGWBH";
                   strValueSQL += "," + model.ZDGWBH + "";
              }

              if(model.Changed("JCCS") == true && model.JCCS != null)
              {
                   strFieldSQL += ",JCCS";
                   strValueSQL += "," + model.JCCS + "";
              }

              if(model.Changed("JCLSH") == true && model.JCLSH != null)
              {
                   strFieldSQL += ",JCLSH";
                   strValueSQL += ",'" + model.JCLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYXM") == true && model.JYXM != null)
              {
                   strFieldSQL += ",JYXM";
                   strValueSQL += ",'" + model.JYXM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YJXM") == true && model.YJXM != null)
              {
                   strFieldSQL += ",YJXM";
                   strValueSQL += ",'" + model.YJXM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("FJXM") == true && model.FJXM != null)
              {
                   strFieldSQL += ",FJXM";
                   strValueSQL += ",'" + model.FJXM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JCBGDBH01") == true && model.JCBGDBH01 != null)
              {
                   strFieldSQL += ",JCBGDBH01";
                   strValueSQL += ",'" + model.JCBGDBH01.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JCBGDBH02") == true && model.JCBGDBH02 != null)
              {
                   strFieldSQL += ",JCBGDBH02";
                   strValueSQL += ",'" + model.JCBGDBH02.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HPHM") == true && model.HPHM != null)
              {
                   strFieldSQL += ",HPHM";
                   strValueSQL += ",'" + model.HPHM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HPZL") == true && model.HPZL != null)
              {
                   strFieldSQL += ",HPZL";
                   strValueSQL += ",'" + model.HPZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HPZLDH") == true && model.HPZLDH != null)
              {
                   strFieldSQL += ",HPZLDH";
                   strValueSQL += ",'" + model.HPZLDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GLCHPHM") == true && model.GLCHPHM != null)
              {
                   strFieldSQL += ",GLCHPHM";
                   strValueSQL += ",'" + model.GLCHPHM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLZLDH") == true && model.CLZLDH != null)
              {
                   strFieldSQL += ",CLZLDH";
                   strValueSQL += ",'" + model.CLZLDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("VIN") == true && model.VIN != null)
              {
                   strFieldSQL += ",VIN";
                   strValueSQL += ",'" + model.VIN.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYLB") == true && model.JYLB != null)
              {
                   strFieldSQL += ",JYLB";
                   strValueSQL += ",'" + model.JYLB.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYLBDH") == true && model.JYLBDH != null)
              {
                   strFieldSQL += ",JYLBDH";
                   strValueSQL += ",'" + model.JYLBDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QDXS") == true && model.QDXS != null)
              {
                   strFieldSQL += ",QDXS";
                   strValueSQL += ",'" + model.QDXS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QZDZ") == true && model.QZDZ != null)
              {
                   strFieldSQL += ",QZDZ";
                   strValueSQL += ",'" + model.QZDZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YGGSNFKT") == true && model.YGGSNFKT != null)
              {
                   strFieldSQL += ",YGGSNFKT";
                   strValueSQL += ",'" + model.YGGSNFKT.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("RLLB") == true && model.RLLB != null)
              {
                   strFieldSQL += ",RLLB";
                   strValueSQL += ",'" + model.RLLB.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZBZL") == true && model.ZBZL != null)
              {
                   strFieldSQL += ",ZBZL";
                   strValueSQL += ",'" + model.ZBZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("BSXLX") == true && model.BSXLX != null)
              {
                   strFieldSQL += ",BSXLX";
                   strValueSQL += ",'" + model.BSXLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLSXSJ") == true && model.CLSXSJ != null)
              {
                   strFieldSQL += ",CLSXSJ";
                   strValueSQL += ",'" + model.CLSXSJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLXXSJ") == true && model.CLXXSJ != null)
              {
                   strFieldSQL += ",CLXXSJ";
                   strValueSQL += ",'" + model.CLXXSJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DLY") == true && model.DLY != null)
              {
                   strFieldSQL += ",DLY";
                   strValueSQL += ",'" + model.DLY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YCY") == true && model.YCY != null)
              {
                   strFieldSQL += ",YCY";
                   strValueSQL += ",'" + model.YCY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WGJYY") == true && model.WGJYY != null)
              {
                   strFieldSQL += ",WGJYY";
                   strValueSQL += ",'" + model.WGJYY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DPJYY") == true && model.DPJYY != null)
              {
                   strFieldSQL += ",DPJYY";
                   strValueSQL += ",'" + model.DPJYY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DTDPJYY") == true && model.DTDPJYY != null)
              {
                   strFieldSQL += ",DTDPJYY";
                   strValueSQL += ",'" + model.DTDPJYY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LSJYY") == true && model.LSJYY != null)
              {
                   strFieldSQL += ",LSJYY";
                   strValueSQL += ",'" + model.LSJYY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SQQZR") == true && model.SQQZR != null)
              {
                   strFieldSQL += ",SQQZR";
                   strValueSQL += ",'" + model.SQQZR.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WQCZY") == true && model.WQCZY != null)
              {
                   strFieldSQL += ",WQCZY";
                   strValueSQL += ",'" + model.WQCZY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GXRQ") == true && model.GXRQ != null)
              {
                   strFieldSQL += ",GXRQ";
                   strValueSQL += ",'" + model.GXRQ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYXM_EX") == true && model.JYXM_EX != null)
              {
                   strFieldSQL += ",JYXM_EX";
                   strValueSQL += ",'" + model.JYXM_EX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZZS") == true && model.ZZS != null)
              {
                   strFieldSQL += ",ZZS";
                   strValueSQL += ",'" + model.ZZS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GLCJCLSH") == true && model.GLCJCLSH != null)
              {
                   strFieldSQL += ",GLCJCLSH";
                   strValueSQL += ",'" + model.GLCJCLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GLCHPZL") == true && model.GLCHPZL != null)
              {
                   strFieldSQL += ",GLCHPZL";
                   strValueSQL += ",'" + model.GLCHPZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GLCHPZLDH") == true && model.GLCHPZLDH != null)
              {
                   strFieldSQL += ",GLCHPZLDH";
                   strValueSQL += ",'" + model.GLCHPZLDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LWCXWZJL") == true && model.LWCXWZJL != null)
              {
                   strFieldSQL += ",LWCXWZJL";
                   strValueSQL += ",'" + model.LWCXWZJL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SFSQCLC") == true && model.SFSQCLC != null)
              {
                   strFieldSQL += ",SFSQCLC";
                   strValueSQL += ",'" + model.SFSQCLC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GLCJYXM") == true && model.GLCJYXM != null)
              {
                   strFieldSQL += ",GLCJYXM";
                   strValueSQL += ",'" + model.GLCJYXM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LWCXWZJLDH") == true && model.LWCXWZJLDH != null)
              {
                   strFieldSQL += ",LWCXWZJLDH";
                   strValueSQL += ",'" + model.LWCXWZJLDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HDZH") == true && model.HDZH != null)
              {
                   strFieldSQL += ",HDZH";
                   strValueSQL += ",'" + model.HDZH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("EDNJGL") == true && model.EDNJGL != null)
              {
                   strFieldSQL += ",EDNJGL";
                   strValueSQL += ",'" + model.EDNJGL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JZZZWZ") == true && model.JZZZWZ != null)
              {
                   strFieldSQL += ",JZZZWZ";
                   strValueSQL += ",'" + model.JZZZWZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("FWQ_ZYXZ") == true && model.FWQ_ZYXZ != null)
              {
                   strFieldSQL += ",FWQ_ZYXZ";
                   strValueSQL += ",'" + model.FWQ_ZYXZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LWLRLSH") == true && model.LWLRLSH != null)
              {
                   strFieldSQL += ",LWLRLSH";
                   strValueSQL += ",'" + model.LWLRLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LWLRHENF") == true && model.LWLRHENF != null)
              {
                   strFieldSQL += ",LWLRHENF";
                   strValueSQL += ",'" + model.LWLRHENF.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTGGLX") == true && model.LTGGLX != null)
              {
                   strFieldSQL += ",LTGGLX";
                   strValueSQL += ",'" + model.LTGGLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTGGLXDH") == true && model.LTGGLXDH != null)
              {
                   strFieldSQL += ",LTGGLXDH";
                   strValueSQL += ",'" + model.LTGGLXDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QDZKZZL") == true && model.QDZKZZL != null)
              {
                   strFieldSQL += ",QDZKZZL";
                   strValueSQL += ",'" + model.QDZKZZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WQLSH") == true && model.WQLSH != null)
              {
                   strFieldSQL += ",WQLSH";
                   strValueSQL += ",'" + model.WQLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("AJLSH") == true && model.AJLSH != null)
              {
                   strFieldSQL += ",AJLSH";
                   strValueSQL += ",'" + model.AJLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZJLSH") == true && model.ZJLSH != null)
              {
                   strFieldSQL += ",ZJLSH";
                   strValueSQL += ",'" + model.ZJLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("MTLSH") == true && model.MTLSH != null)
              {
                   strFieldSQL += ",MTLSH";
                   strValueSQL += ",'" + model.MTLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZZL") == true && model.ZZL != null)
              {
                   strFieldSQL += ",ZZL";
                   strValueSQL += ",'" + model.ZZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("MTCSFDJSS") == true && model.MTCSFDJSS != null)
              {
                   strFieldSQL += ",MTCSFDJSS";
                   strValueSQL += ",'" + model.MTCSFDJSS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("MTCSFDJSSDH") == true && model.MTCSFDJSSDH != null)
              {
                   strFieldSQL += ",MTCSFDJSSDH";
                   strValueSQL += ",'" + model.MTCSFDJSSDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZYWLB") == true && model.ZYWLB != null)
              {
                   strFieldSQL += ",ZYWLB";
                   strValueSQL += ",'" + model.ZYWLB.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZYWLBDH") == true && model.ZYWLBDH != null)
              {
                   strFieldSQL += ",ZYWLBDH";
                   strValueSQL += ",'" + model.ZYWLBDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYLB_TYPE") == true && model.JYLB_TYPE != null)
              {
                   strFieldSQL += ",JYLB_TYPE";
                   strValueSQL += ",'" + model.JYLB_TYPE.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLSSLB") == true && model.CLSSLB != null)
              {
                   strFieldSQL += ",CLSSLB";
                   strValueSQL += ",'" + model.CLSSLB.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLSSLBDH") == true && model.CLSSLBDH != null)
              {
                   strFieldSQL += ",CLSSLBDH";
                   strValueSQL += ",'" + model.CLSSLBDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SYRSFZ") == true && model.SYRSFZ != null)
              {
                   strFieldSQL += ",SYRSFZ";
                   strValueSQL += ",'" + model.SYRSFZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZJJYRQ") == true && model.ZJJYRQ != null)
              {
                   strFieldSQL += ",ZJJYRQ";
                   strValueSQL += ",'" + model.ZJJYRQ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("BXZZRQ") == true && model.BXZZRQ != null)
              {
                   strFieldSQL += ",BXZZRQ";
                   strValueSQL += ",'" + model.BXZZRQ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYYXQZ") == true && model.JYYXQZ != null)
              {
                   strFieldSQL += ",JYYXQZ";
                   strValueSQL += ",'" + model.JYYXQZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLYTDH") == true && model.CLYTDH != null)
              {
                   strFieldSQL += ",CLYTDH";
                   strValueSQL += ",'" + model.CLYTDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YTSXDH") == true && model.YTSXDH != null)
              {
                   strFieldSQL += ",YTSXDH";
                   strValueSQL += ",'" + model.YTSXDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYXM_LW") == true && model.JYXM_LW != null)
              {
                   strFieldSQL += ",JYXM_LW";
                   strValueSQL += ",'" + model.JYXM_LW.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WAIT_LINE") == true && model.WAIT_LINE != null)
              {
                   strFieldSQL += ",WAIT_LINE";
                   strValueSQL += "," + model.WAIT_LINE + "";
              }

              if(model.Changed("GCPZH") == true && model.GCPZH != null)
              {
                   strFieldSQL += ",GCPZH";
                   strValueSQL += ",'" + model.GCPZH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCLX") == true && model.GCLX != null)
              {
                   strFieldSQL += ",GCLX";
                   strValueSQL += ",'" + model.GCLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCLXDH") == true && model.GCLXDH != null)
              {
                   strFieldSQL += ",GCLXDH";
                   strValueSQL += ",'" + model.GCLXDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QYCMZZZL") == true && model.QYCMZZZL != null)
              {
                   strFieldSQL += ",QYCMZZZL";
                   strValueSQL += ",'" + model.QYCMZZZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DCZS") == true && model.DCZS != null)
              {
                   strFieldSQL += ",DCZS";
                   strValueSQL += ",'" + model.DCZS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("XZQY") == true && model.XZQY != null)
              {
                   strFieldSQL += ",XZQY";
                   strValueSQL += ",'" + model.XZQY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCLBGD") == true && model.ZCLBGD != null)
              {
                   strFieldSQL += ",ZCLBGD";
                   strValueSQL += ",'" + model.ZCLBGD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCLBGD") == true && model.GCLBGD != null)
              {
                   strFieldSQL += ",GCLBGD";
                   strValueSQL += ",'" + model.GCLBGD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCCSC") == true && model.GCCSC != null)
              {
                   strFieldSQL += ",GCCSC";
                   strValueSQL += ",'" + model.GCCSC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCCSK") == true && model.GCCSK != null)
              {
                   strFieldSQL += ",GCCSK";
                   strValueSQL += ",'" + model.GCCSK.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCCSG") == true && model.GCCSG != null)
              {
                   strFieldSQL += ",GCCSG";
                   strValueSQL += ",'" + model.GCCSG.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCBZZXS") == true && model.GCBZZXS != null)
              {
                   strFieldSQL += ",GCBZZXS";
                   strValueSQL += ",'" + model.GCBZZXS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCBZZXSDH") == true && model.GCBZZXSDH != null)
              {
                   strFieldSQL += ",GCBZZXSDH";
                   strValueSQL += ",'" + model.GCBZZXSDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZJCLLX") == true && model.ZJCLLX != null)
              {
                   strFieldSQL += ",ZJCLLX";
                   strValueSQL += ",'" + model.ZJCLLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZJCLLXDH") == true && model.ZJCLLXDH != null)
              {
                   strFieldSQL += ",ZJCLLXDH";
                   strValueSQL += ",'" + model.ZJCLLXDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SFSWPC") == true && model.SFSWPC != null)
              {
                   strFieldSQL += ",SFSWPC";
                   strValueSQL += ",'" + model.SFSWPC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DLYSZH") == true && model.DLYSZH != null)
              {
                   strFieldSQL += ",DLYSZH";
                   strValueSQL += ",'" + model.DLYSZH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SFSGSQC") == true && model.SFSGSQC != null)
              {
                   strFieldSQL += ",SFSGSQC";
                   strValueSQL += ",'" + model.SFSGSQC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLCCLX") == true && model.CLCCLX != null)
              {
                   strFieldSQL += ",CLCCLX";
                   strValueSQL += ",'" + model.CLCCLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLCCLXDH") == true && model.CLCCLXDH != null)
              {
                   strFieldSQL += ",CLCCLXDH";
                   strValueSQL += ",'" + model.CLCCLXDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DLRQ") == true && model.DLRQ != null)
              {
                   strFieldSQL += ",DLRQ";
                   strValueSQL += ",'" + model.DLRQ.ToString().Replace("'","''") + "'";
              }

              string strSql = "";
              strSql += "insert into VEHICLE_DISPATCH";
              strSql += "(";
              strSql += strFieldSQL.Substring(1);
              strSql += ")";
              strSql += " values";
              strSql += "(";
              strSql += strValueSQL.Substring(1);
              strSql += ")";

              return strSql;
          }

          /// <summary>
          /// 添加一条数据
          /// </summary>
          public bool Insert(VEHICLE_DISPATCH model)
          {
              return DbHelper.ExecuteSql(InsertSQL(model));
          }

          /// <summary>
          /// 修改一条数据 SQL
          /// </summary>
          public string UpdateSQL(VEHICLE_DISPATCH model,string strJCLSH)
          {
              string strUpdateSQL = "";

              if(model.Changed("VEHICLEID") == true && model.VEHICLEID != null)
              {
                  strUpdateSQL += ",VEHICLEID='" + model.VEHICLEID.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JCXH") == true && model.JCXH != null)
              {
                  strUpdateSQL += ",JCXH=" + model.JCXH + "";
              }

              if(model.Changed("JCXHMS") == true && model.JCXHMS != null)
              {
                  strUpdateSQL += ",JCXHMS='" + model.JCXHMS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SCJCXH") == true && model.SCJCXH != null)
              {
                  strUpdateSQL += ",SCJCXH=" + model.SCJCXH + "";
              }

              if(model.Changed("JCZT_STATUS") == true && model.JCZT_STATUS != null)
              {
                  strUpdateSQL += ",JCZT_STATUS=" + model.JCZT_STATUS + "";
              }

              if(model.Changed("GW_STATUS") == true && model.GW_STATUS != null)
              {
                  strUpdateSQL += ",GW_STATUS=" + model.GW_STATUS + "";
              }

              if(model.Changed("GWBH") == true && model.GWBH != null)
              {
                  strUpdateSQL += ",GWBH=" + model.GWBH + "";
              }

              if(model.Changed("YJGWH") == true && model.YJGWH != null)
              {
                  strUpdateSQL += ",YJGWH='" + model.YJGWH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZDGWBH") == true && model.ZDGWBH != null)
              {
                  strUpdateSQL += ",ZDGWBH=" + model.ZDGWBH + "";
              }

              if(model.Changed("JCCS") == true && model.JCCS != null)
              {
                  strUpdateSQL += ",JCCS=" + model.JCCS + "";
              }

              if(model.Changed("JCLSH") == true && model.JCLSH != null)
              {
                  strUpdateSQL += ",JCLSH='" + model.JCLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYXM") == true && model.JYXM != null)
              {
                  strUpdateSQL += ",JYXM='" + model.JYXM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YJXM") == true && model.YJXM != null)
              {
                  strUpdateSQL += ",YJXM='" + model.YJXM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("FJXM") == true && model.FJXM != null)
              {
                  strUpdateSQL += ",FJXM='" + model.FJXM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JCBGDBH01") == true && model.JCBGDBH01 != null)
              {
                  strUpdateSQL += ",JCBGDBH01='" + model.JCBGDBH01.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JCBGDBH02") == true && model.JCBGDBH02 != null)
              {
                  strUpdateSQL += ",JCBGDBH02='" + model.JCBGDBH02.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HPHM") == true && model.HPHM != null)
              {
                  strUpdateSQL += ",HPHM='" + model.HPHM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HPZL") == true && model.HPZL != null)
              {
                  strUpdateSQL += ",HPZL='" + model.HPZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HPZLDH") == true && model.HPZLDH != null)
              {
                  strUpdateSQL += ",HPZLDH='" + model.HPZLDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GLCHPHM") == true && model.GLCHPHM != null)
              {
                  strUpdateSQL += ",GLCHPHM='" + model.GLCHPHM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLZLDH") == true && model.CLZLDH != null)
              {
                  strUpdateSQL += ",CLZLDH='" + model.CLZLDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("VIN") == true && model.VIN != null)
              {
                  strUpdateSQL += ",VIN='" + model.VIN.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYLB") == true && model.JYLB != null)
              {
                  strUpdateSQL += ",JYLB='" + model.JYLB.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYLBDH") == true && model.JYLBDH != null)
              {
                  strUpdateSQL += ",JYLBDH='" + model.JYLBDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QDXS") == true && model.QDXS != null)
              {
                  strUpdateSQL += ",QDXS='" + model.QDXS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QZDZ") == true && model.QZDZ != null)
              {
                  strUpdateSQL += ",QZDZ='" + model.QZDZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YGGSNFKT") == true && model.YGGSNFKT != null)
              {
                  strUpdateSQL += ",YGGSNFKT='" + model.YGGSNFKT.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("RLLB") == true && model.RLLB != null)
              {
                  strUpdateSQL += ",RLLB='" + model.RLLB.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZBZL") == true && model.ZBZL != null)
              {
                  strUpdateSQL += ",ZBZL='" + model.ZBZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("BSXLX") == true && model.BSXLX != null)
              {
                  strUpdateSQL += ",BSXLX='" + model.BSXLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLSXSJ") == true && model.CLSXSJ != null)
              {
                  strUpdateSQL += ",CLSXSJ='" + model.CLSXSJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLXXSJ") == true && model.CLXXSJ != null)
              {
                  strUpdateSQL += ",CLXXSJ='" + model.CLXXSJ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DLY") == true && model.DLY != null)
              {
                  strUpdateSQL += ",DLY='" + model.DLY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YCY") == true && model.YCY != null)
              {
                  strUpdateSQL += ",YCY='" + model.YCY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WGJYY") == true && model.WGJYY != null)
              {
                  strUpdateSQL += ",WGJYY='" + model.WGJYY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DPJYY") == true && model.DPJYY != null)
              {
                  strUpdateSQL += ",DPJYY='" + model.DPJYY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DTDPJYY") == true && model.DTDPJYY != null)
              {
                  strUpdateSQL += ",DTDPJYY='" + model.DTDPJYY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LSJYY") == true && model.LSJYY != null)
              {
                  strUpdateSQL += ",LSJYY='" + model.LSJYY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SQQZR") == true && model.SQQZR != null)
              {
                  strUpdateSQL += ",SQQZR='" + model.SQQZR.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WQCZY") == true && model.WQCZY != null)
              {
                  strUpdateSQL += ",WQCZY='" + model.WQCZY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GXRQ") == true && model.GXRQ != null)
              {
                  strUpdateSQL += ",GXRQ='" + model.GXRQ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYXM_EX") == true && model.JYXM_EX != null)
              {
                  strUpdateSQL += ",JYXM_EX='" + model.JYXM_EX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZZS") == true && model.ZZS != null)
              {
                  strUpdateSQL += ",ZZS='" + model.ZZS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GLCJCLSH") == true && model.GLCJCLSH != null)
              {
                  strUpdateSQL += ",GLCJCLSH='" + model.GLCJCLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GLCHPZL") == true && model.GLCHPZL != null)
              {
                  strUpdateSQL += ",GLCHPZL='" + model.GLCHPZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GLCHPZLDH") == true && model.GLCHPZLDH != null)
              {
                  strUpdateSQL += ",GLCHPZLDH='" + model.GLCHPZLDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LWCXWZJL") == true && model.LWCXWZJL != null)
              {
                  strUpdateSQL += ",LWCXWZJL='" + model.LWCXWZJL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SFSQCLC") == true && model.SFSQCLC != null)
              {
                  strUpdateSQL += ",SFSQCLC='" + model.SFSQCLC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GLCJYXM") == true && model.GLCJYXM != null)
              {
                  strUpdateSQL += ",GLCJYXM='" + model.GLCJYXM.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LWCXWZJLDH") == true && model.LWCXWZJLDH != null)
              {
                  strUpdateSQL += ",LWCXWZJLDH='" + model.LWCXWZJLDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("HDZH") == true && model.HDZH != null)
              {
                  strUpdateSQL += ",HDZH='" + model.HDZH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("EDNJGL") == true && model.EDNJGL != null)
              {
                  strUpdateSQL += ",EDNJGL='" + model.EDNJGL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JZZZWZ") == true && model.JZZZWZ != null)
              {
                  strUpdateSQL += ",JZZZWZ='" + model.JZZZWZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("FWQ_ZYXZ") == true && model.FWQ_ZYXZ != null)
              {
                  strUpdateSQL += ",FWQ_ZYXZ='" + model.FWQ_ZYXZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LWLRLSH") == true && model.LWLRLSH != null)
              {
                  strUpdateSQL += ",LWLRLSH='" + model.LWLRLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LWLRHENF") == true && model.LWLRHENF != null)
              {
                  strUpdateSQL += ",LWLRHENF='" + model.LWLRHENF.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTGGLX") == true && model.LTGGLX != null)
              {
                  strUpdateSQL += ",LTGGLX='" + model.LTGGLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("LTGGLXDH") == true && model.LTGGLXDH != null)
              {
                  strUpdateSQL += ",LTGGLXDH='" + model.LTGGLXDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QDZKZZL") == true && model.QDZKZZL != null)
              {
                  strUpdateSQL += ",QDZKZZL='" + model.QDZKZZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WQLSH") == true && model.WQLSH != null)
              {
                  strUpdateSQL += ",WQLSH='" + model.WQLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("AJLSH") == true && model.AJLSH != null)
              {
                  strUpdateSQL += ",AJLSH='" + model.AJLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZJLSH") == true && model.ZJLSH != null)
              {
                  strUpdateSQL += ",ZJLSH='" + model.ZJLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("MTLSH") == true && model.MTLSH != null)
              {
                  strUpdateSQL += ",MTLSH='" + model.MTLSH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZZL") == true && model.ZZL != null)
              {
                  strUpdateSQL += ",ZZL='" + model.ZZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("MTCSFDJSS") == true && model.MTCSFDJSS != null)
              {
                  strUpdateSQL += ",MTCSFDJSS='" + model.MTCSFDJSS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("MTCSFDJSSDH") == true && model.MTCSFDJSSDH != null)
              {
                  strUpdateSQL += ",MTCSFDJSSDH='" + model.MTCSFDJSSDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZYWLB") == true && model.ZYWLB != null)
              {
                  strUpdateSQL += ",ZYWLB='" + model.ZYWLB.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZYWLBDH") == true && model.ZYWLBDH != null)
              {
                  strUpdateSQL += ",ZYWLBDH='" + model.ZYWLBDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYLB_TYPE") == true && model.JYLB_TYPE != null)
              {
                  strUpdateSQL += ",JYLB_TYPE='" + model.JYLB_TYPE.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLSSLB") == true && model.CLSSLB != null)
              {
                  strUpdateSQL += ",CLSSLB='" + model.CLSSLB.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLSSLBDH") == true && model.CLSSLBDH != null)
              {
                  strUpdateSQL += ",CLSSLBDH='" + model.CLSSLBDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SYRSFZ") == true && model.SYRSFZ != null)
              {
                  strUpdateSQL += ",SYRSFZ='" + model.SYRSFZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZJJYRQ") == true && model.ZJJYRQ != null)
              {
                  strUpdateSQL += ",ZJJYRQ='" + model.ZJJYRQ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("BXZZRQ") == true && model.BXZZRQ != null)
              {
                  strUpdateSQL += ",BXZZRQ='" + model.BXZZRQ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYYXQZ") == true && model.JYYXQZ != null)
              {
                  strUpdateSQL += ",JYYXQZ='" + model.JYYXQZ.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLYTDH") == true && model.CLYTDH != null)
              {
                  strUpdateSQL += ",CLYTDH='" + model.CLYTDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("YTSXDH") == true && model.YTSXDH != null)
              {
                  strUpdateSQL += ",YTSXDH='" + model.YTSXDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("JYXM_LW") == true && model.JYXM_LW != null)
              {
                  strUpdateSQL += ",JYXM_LW='" + model.JYXM_LW.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("WAIT_LINE") == true && model.WAIT_LINE != null)
              {
                  strUpdateSQL += ",WAIT_LINE=" + model.WAIT_LINE + "";
              }

              if(model.Changed("GCPZH") == true && model.GCPZH != null)
              {
                  strUpdateSQL += ",GCPZH='" + model.GCPZH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCLX") == true && model.GCLX != null)
              {
                  strUpdateSQL += ",GCLX='" + model.GCLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCLXDH") == true && model.GCLXDH != null)
              {
                  strUpdateSQL += ",GCLXDH='" + model.GCLXDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("QYCMZZZL") == true && model.QYCMZZZL != null)
              {
                  strUpdateSQL += ",QYCMZZZL='" + model.QYCMZZZL.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DCZS") == true && model.DCZS != null)
              {
                  strUpdateSQL += ",DCZS='" + model.DCZS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("XZQY") == true && model.XZQY != null)
              {
                  strUpdateSQL += ",XZQY='" + model.XZQY.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZCLBGD") == true && model.ZCLBGD != null)
              {
                  strUpdateSQL += ",ZCLBGD='" + model.ZCLBGD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCLBGD") == true && model.GCLBGD != null)
              {
                  strUpdateSQL += ",GCLBGD='" + model.GCLBGD.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCCSC") == true && model.GCCSC != null)
              {
                  strUpdateSQL += ",GCCSC='" + model.GCCSC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCCSK") == true && model.GCCSK != null)
              {
                  strUpdateSQL += ",GCCSK='" + model.GCCSK.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCCSG") == true && model.GCCSG != null)
              {
                  strUpdateSQL += ",GCCSG='" + model.GCCSG.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCBZZXS") == true && model.GCBZZXS != null)
              {
                  strUpdateSQL += ",GCBZZXS='" + model.GCBZZXS.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("GCBZZXSDH") == true && model.GCBZZXSDH != null)
              {
                  strUpdateSQL += ",GCBZZXSDH='" + model.GCBZZXSDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZJCLLX") == true && model.ZJCLLX != null)
              {
                  strUpdateSQL += ",ZJCLLX='" + model.ZJCLLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("ZJCLLXDH") == true && model.ZJCLLXDH != null)
              {
                  strUpdateSQL += ",ZJCLLXDH='" + model.ZJCLLXDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SFSWPC") == true && model.SFSWPC != null)
              {
                  strUpdateSQL += ",SFSWPC='" + model.SFSWPC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DLYSZH") == true && model.DLYSZH != null)
              {
                  strUpdateSQL += ",DLYSZH='" + model.DLYSZH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("SFSGSQC") == true && model.SFSGSQC != null)
              {
                  strUpdateSQL += ",SFSGSQC='" + model.SFSGSQC.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLCCLX") == true && model.CLCCLX != null)
              {
                  strUpdateSQL += ",CLCCLX='" + model.CLCCLX.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("CLCCLXDH") == true && model.CLCCLXDH != null)
              {
                  strUpdateSQL += ",CLCCLXDH='" + model.CLCCLXDH.ToString().Replace("'","''") + "'";
              }

              if(model.Changed("DLRQ") == true && model.DLRQ != null)
              {
                  strUpdateSQL += ",DLRQ='" + model.DLRQ.ToString().Replace("'","''") + "'";
              }

               string strSql = "";
               strSql += "update VEHICLE_DISPATCH set ";
               strSql += strUpdateSQL.Substring(1);
               strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

               return strSql;
          }

          /// <summary>
          /// 修改一条数据
          /// </summary>
          public bool Update(VEHICLE_DISPATCH model, string strJCLSH)
          {
              return DbHelper.ExecuteSql(UpdateSQL(model, strJCLSH));
          }

          /// <summary>
          /// 修改一个集合 SQL
          /// </summary>
           public string UpdateRangeSQL(VEHICLE_DISPATCH model, string p_strWhere)
          {
               string strUpdateSQL = "";

               if(model.Changed("VEHICLEID") == true && model.VEHICLEID != null)
               {
                  strUpdateSQL += ",VEHICLEID='" + model.VEHICLEID.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JCXH") == true && model.JCXH != null)
               {
                  strUpdateSQL += ",JCXH=" + model.JCXH + "";
               }

               if(model.Changed("JCXHMS") == true && model.JCXHMS != null)
               {
                  strUpdateSQL += ",JCXHMS='" + model.JCXHMS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SCJCXH") == true && model.SCJCXH != null)
               {
                  strUpdateSQL += ",SCJCXH=" + model.SCJCXH + "";
               }

               if(model.Changed("JCZT_STATUS") == true && model.JCZT_STATUS != null)
               {
                  strUpdateSQL += ",JCZT_STATUS=" + model.JCZT_STATUS + "";
               }

               if(model.Changed("GW_STATUS") == true && model.GW_STATUS != null)
               {
                  strUpdateSQL += ",GW_STATUS=" + model.GW_STATUS + "";
               }

               if(model.Changed("GWBH") == true && model.GWBH != null)
               {
                  strUpdateSQL += ",GWBH=" + model.GWBH + "";
               }

               if(model.Changed("YJGWH") == true && model.YJGWH != null)
               {
                  strUpdateSQL += ",YJGWH='" + model.YJGWH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZDGWBH") == true && model.ZDGWBH != null)
               {
                  strUpdateSQL += ",ZDGWBH=" + model.ZDGWBH + "";
               }

               if(model.Changed("JCCS") == true && model.JCCS != null)
               {
                  strUpdateSQL += ",JCCS=" + model.JCCS + "";
               }

               if(model.Changed("JCLSH") == true && model.JCLSH != null)
               {
                  strUpdateSQL += ",JCLSH='" + model.JCLSH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JYXM") == true && model.JYXM != null)
               {
                  strUpdateSQL += ",JYXM='" + model.JYXM.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YJXM") == true && model.YJXM != null)
               {
                  strUpdateSQL += ",YJXM='" + model.YJXM.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("FJXM") == true && model.FJXM != null)
               {
                  strUpdateSQL += ",FJXM='" + model.FJXM.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JCBGDBH01") == true && model.JCBGDBH01 != null)
               {
                  strUpdateSQL += ",JCBGDBH01='" + model.JCBGDBH01.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JCBGDBH02") == true && model.JCBGDBH02 != null)
               {
                  strUpdateSQL += ",JCBGDBH02='" + model.JCBGDBH02.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HPHM") == true && model.HPHM != null)
               {
                  strUpdateSQL += ",HPHM='" + model.HPHM.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HPZL") == true && model.HPZL != null)
               {
                  strUpdateSQL += ",HPZL='" + model.HPZL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HPZLDH") == true && model.HPZLDH != null)
               {
                  strUpdateSQL += ",HPZLDH='" + model.HPZLDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GLCHPHM") == true && model.GLCHPHM != null)
               {
                  strUpdateSQL += ",GLCHPHM='" + model.GLCHPHM.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CLZLDH") == true && model.CLZLDH != null)
               {
                  strUpdateSQL += ",CLZLDH='" + model.CLZLDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("VIN") == true && model.VIN != null)
               {
                  strUpdateSQL += ",VIN='" + model.VIN.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JYLB") == true && model.JYLB != null)
               {
                  strUpdateSQL += ",JYLB='" + model.JYLB.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JYLBDH") == true && model.JYLBDH != null)
               {
                  strUpdateSQL += ",JYLBDH='" + model.JYLBDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("QDXS") == true && model.QDXS != null)
               {
                  strUpdateSQL += ",QDXS='" + model.QDXS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("QZDZ") == true && model.QZDZ != null)
               {
                  strUpdateSQL += ",QZDZ='" + model.QZDZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YGGSNFKT") == true && model.YGGSNFKT != null)
               {
                  strUpdateSQL += ",YGGSNFKT='" + model.YGGSNFKT.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("RLLB") == true && model.RLLB != null)
               {
                  strUpdateSQL += ",RLLB='" + model.RLLB.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZBZL") == true && model.ZBZL != null)
               {
                  strUpdateSQL += ",ZBZL='" + model.ZBZL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("BSXLX") == true && model.BSXLX != null)
               {
                  strUpdateSQL += ",BSXLX='" + model.BSXLX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CLSXSJ") == true && model.CLSXSJ != null)
               {
                  strUpdateSQL += ",CLSXSJ='" + model.CLSXSJ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CLXXSJ") == true && model.CLXXSJ != null)
               {
                  strUpdateSQL += ",CLXXSJ='" + model.CLXXSJ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("DLY") == true && model.DLY != null)
               {
                  strUpdateSQL += ",DLY='" + model.DLY.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YCY") == true && model.YCY != null)
               {
                  strUpdateSQL += ",YCY='" + model.YCY.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("WGJYY") == true && model.WGJYY != null)
               {
                  strUpdateSQL += ",WGJYY='" + model.WGJYY.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("DPJYY") == true && model.DPJYY != null)
               {
                  strUpdateSQL += ",DPJYY='" + model.DPJYY.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("DTDPJYY") == true && model.DTDPJYY != null)
               {
                  strUpdateSQL += ",DTDPJYY='" + model.DTDPJYY.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LSJYY") == true && model.LSJYY != null)
               {
                  strUpdateSQL += ",LSJYY='" + model.LSJYY.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SQQZR") == true && model.SQQZR != null)
               {
                  strUpdateSQL += ",SQQZR='" + model.SQQZR.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("WQCZY") == true && model.WQCZY != null)
               {
                  strUpdateSQL += ",WQCZY='" + model.WQCZY.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GXRQ") == true && model.GXRQ != null)
               {
                  strUpdateSQL += ",GXRQ='" + model.GXRQ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JYXM_EX") == true && model.JYXM_EX != null)
               {
                  strUpdateSQL += ",JYXM_EX='" + model.JYXM_EX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZZS") == true && model.ZZS != null)
               {
                  strUpdateSQL += ",ZZS='" + model.ZZS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GLCJCLSH") == true && model.GLCJCLSH != null)
               {
                  strUpdateSQL += ",GLCJCLSH='" + model.GLCJCLSH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GLCHPZL") == true && model.GLCHPZL != null)
               {
                  strUpdateSQL += ",GLCHPZL='" + model.GLCHPZL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GLCHPZLDH") == true && model.GLCHPZLDH != null)
               {
                  strUpdateSQL += ",GLCHPZLDH='" + model.GLCHPZLDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LWCXWZJL") == true && model.LWCXWZJL != null)
               {
                  strUpdateSQL += ",LWCXWZJL='" + model.LWCXWZJL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SFSQCLC") == true && model.SFSQCLC != null)
               {
                  strUpdateSQL += ",SFSQCLC='" + model.SFSQCLC.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GLCJYXM") == true && model.GLCJYXM != null)
               {
                  strUpdateSQL += ",GLCJYXM='" + model.GLCJYXM.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LWCXWZJLDH") == true && model.LWCXWZJLDH != null)
               {
                  strUpdateSQL += ",LWCXWZJLDH='" + model.LWCXWZJLDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("HDZH") == true && model.HDZH != null)
               {
                  strUpdateSQL += ",HDZH='" + model.HDZH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("EDNJGL") == true && model.EDNJGL != null)
               {
                  strUpdateSQL += ",EDNJGL='" + model.EDNJGL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JZZZWZ") == true && model.JZZZWZ != null)
               {
                  strUpdateSQL += ",JZZZWZ='" + model.JZZZWZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("FWQ_ZYXZ") == true && model.FWQ_ZYXZ != null)
               {
                  strUpdateSQL += ",FWQ_ZYXZ='" + model.FWQ_ZYXZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LWLRLSH") == true && model.LWLRLSH != null)
               {
                  strUpdateSQL += ",LWLRLSH='" + model.LWLRLSH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LWLRHENF") == true && model.LWLRHENF != null)
               {
                  strUpdateSQL += ",LWLRHENF='" + model.LWLRHENF.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LTGGLX") == true && model.LTGGLX != null)
               {
                  strUpdateSQL += ",LTGGLX='" + model.LTGGLX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("LTGGLXDH") == true && model.LTGGLXDH != null)
               {
                  strUpdateSQL += ",LTGGLXDH='" + model.LTGGLXDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("QDZKZZL") == true && model.QDZKZZL != null)
               {
                  strUpdateSQL += ",QDZKZZL='" + model.QDZKZZL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("WQLSH") == true && model.WQLSH != null)
               {
                  strUpdateSQL += ",WQLSH='" + model.WQLSH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("AJLSH") == true && model.AJLSH != null)
               {
                  strUpdateSQL += ",AJLSH='" + model.AJLSH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZJLSH") == true && model.ZJLSH != null)
               {
                  strUpdateSQL += ",ZJLSH='" + model.ZJLSH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("MTLSH") == true && model.MTLSH != null)
               {
                  strUpdateSQL += ",MTLSH='" + model.MTLSH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZZL") == true && model.ZZL != null)
               {
                  strUpdateSQL += ",ZZL='" + model.ZZL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("MTCSFDJSS") == true && model.MTCSFDJSS != null)
               {
                  strUpdateSQL += ",MTCSFDJSS='" + model.MTCSFDJSS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("MTCSFDJSSDH") == true && model.MTCSFDJSSDH != null)
               {
                  strUpdateSQL += ",MTCSFDJSSDH='" + model.MTCSFDJSSDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZYWLB") == true && model.ZYWLB != null)
               {
                  strUpdateSQL += ",ZYWLB='" + model.ZYWLB.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZYWLBDH") == true && model.ZYWLBDH != null)
               {
                  strUpdateSQL += ",ZYWLBDH='" + model.ZYWLBDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JYLB_TYPE") == true && model.JYLB_TYPE != null)
               {
                  strUpdateSQL += ",JYLB_TYPE='" + model.JYLB_TYPE.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CLSSLB") == true && model.CLSSLB != null)
               {
                  strUpdateSQL += ",CLSSLB='" + model.CLSSLB.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CLSSLBDH") == true && model.CLSSLBDH != null)
               {
                  strUpdateSQL += ",CLSSLBDH='" + model.CLSSLBDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SYRSFZ") == true && model.SYRSFZ != null)
               {
                  strUpdateSQL += ",SYRSFZ='" + model.SYRSFZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZJJYRQ") == true && model.ZJJYRQ != null)
               {
                  strUpdateSQL += ",ZJJYRQ='" + model.ZJJYRQ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("BXZZRQ") == true && model.BXZZRQ != null)
               {
                  strUpdateSQL += ",BXZZRQ='" + model.BXZZRQ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JYYXQZ") == true && model.JYYXQZ != null)
               {
                  strUpdateSQL += ",JYYXQZ='" + model.JYYXQZ.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CLYTDH") == true && model.CLYTDH != null)
               {
                  strUpdateSQL += ",CLYTDH='" + model.CLYTDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("YTSXDH") == true && model.YTSXDH != null)
               {
                  strUpdateSQL += ",YTSXDH='" + model.YTSXDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("JYXM_LW") == true && model.JYXM_LW != null)
               {
                  strUpdateSQL += ",JYXM_LW='" + model.JYXM_LW.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("WAIT_LINE") == true && model.WAIT_LINE != null)
               {
                  strUpdateSQL += ",WAIT_LINE=" + model.WAIT_LINE + "";
               }

               if(model.Changed("GCPZH") == true && model.GCPZH != null)
               {
                  strUpdateSQL += ",GCPZH='" + model.GCPZH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCLX") == true && model.GCLX != null)
               {
                  strUpdateSQL += ",GCLX='" + model.GCLX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCLXDH") == true && model.GCLXDH != null)
               {
                  strUpdateSQL += ",GCLXDH='" + model.GCLXDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("QYCMZZZL") == true && model.QYCMZZZL != null)
               {
                  strUpdateSQL += ",QYCMZZZL='" + model.QYCMZZZL.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("DCZS") == true && model.DCZS != null)
               {
                  strUpdateSQL += ",DCZS='" + model.DCZS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("XZQY") == true && model.XZQY != null)
               {
                  strUpdateSQL += ",XZQY='" + model.XZQY.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZCLBGD") == true && model.ZCLBGD != null)
               {
                  strUpdateSQL += ",ZCLBGD='" + model.ZCLBGD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCLBGD") == true && model.GCLBGD != null)
               {
                  strUpdateSQL += ",GCLBGD='" + model.GCLBGD.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCCSC") == true && model.GCCSC != null)
               {
                  strUpdateSQL += ",GCCSC='" + model.GCCSC.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCCSK") == true && model.GCCSK != null)
               {
                  strUpdateSQL += ",GCCSK='" + model.GCCSK.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCCSG") == true && model.GCCSG != null)
               {
                  strUpdateSQL += ",GCCSG='" + model.GCCSG.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCBZZXS") == true && model.GCBZZXS != null)
               {
                  strUpdateSQL += ",GCBZZXS='" + model.GCBZZXS.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("GCBZZXSDH") == true && model.GCBZZXSDH != null)
               {
                  strUpdateSQL += ",GCBZZXSDH='" + model.GCBZZXSDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZJCLLX") == true && model.ZJCLLX != null)
               {
                  strUpdateSQL += ",ZJCLLX='" + model.ZJCLLX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("ZJCLLXDH") == true && model.ZJCLLXDH != null)
               {
                  strUpdateSQL += ",ZJCLLXDH='" + model.ZJCLLXDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SFSWPC") == true && model.SFSWPC != null)
               {
                  strUpdateSQL += ",SFSWPC='" + model.SFSWPC.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("DLYSZH") == true && model.DLYSZH != null)
               {
                  strUpdateSQL += ",DLYSZH='" + model.DLYSZH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("SFSGSQC") == true && model.SFSGSQC != null)
               {
                  strUpdateSQL += ",SFSGSQC='" + model.SFSGSQC.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CLCCLX") == true && model.CLCCLX != null)
               {
                  strUpdateSQL += ",CLCCLX='" + model.CLCCLX.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("CLCCLXDH") == true && model.CLCCLXDH != null)
               {
                  strUpdateSQL += ",CLCCLXDH='" + model.CLCCLXDH.ToString().Replace("'","''") + "'";
               }

               if(model.Changed("DLRQ") == true && model.DLRQ != null)
               {
                  strUpdateSQL += ",DLRQ='" + model.DLRQ.ToString().Replace("'","''") + "'";
               }

              string strSql = "";
              strSql += "update VEHICLE_DISPATCH set ";
              strSql += strUpdateSQL.Substring(1);
              strSql += " where " + p_strWhere;

              return strSql;
          }

          /// <summary>
          /// 修改一个集合
          /// </summary>
          public bool UpdateRange(VEHICLE_DISPATCH model, string p_strWhere)
          {
              return DbHelper.ExecuteSql(UpdateRangeSQL(model, p_strWhere));
          }

          /// <summary>
          /// 修改全部数据 SQL
          /// </summary>
          public string UpdateAllSQL(VEHICLE_DISPATCH model)
          {
              string strUpdateSQL = "";

                  strUpdateSQL += ",VEHICLEID='" + model.VEHICLEID.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JCXH=" + model.JCXH + "";
                  strUpdateSQL += ",JCXHMS='" + model.JCXHMS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SCJCXH=" + model.SCJCXH + "";
                  strUpdateSQL += ",JCZT_STATUS=" + model.JCZT_STATUS + "";
                  strUpdateSQL += ",GW_STATUS=" + model.GW_STATUS + "";
                  strUpdateSQL += ",GWBH=" + model.GWBH + "";
                  strUpdateSQL += ",YJGWH='" + model.YJGWH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZDGWBH=" + model.ZDGWBH + "";
                  strUpdateSQL += ",JCCS=" + model.JCCS + "";
                  strUpdateSQL += ",JCLSH='" + model.JCLSH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JYXM='" + model.JYXM.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YJXM='" + model.YJXM.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",FJXM='" + model.FJXM.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JCBGDBH01='" + model.JCBGDBH01.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JCBGDBH02='" + model.JCBGDBH02.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HPHM='" + model.HPHM.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HPZL='" + model.HPZL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HPZLDH='" + model.HPZLDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GLCHPHM='" + model.GLCHPHM.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CLZLDH='" + model.CLZLDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",VIN='" + model.VIN.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JYLB='" + model.JYLB.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JYLBDH='" + model.JYLBDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",QDXS='" + model.QDXS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",QZDZ='" + model.QZDZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YGGSNFKT='" + model.YGGSNFKT.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",RLLB='" + model.RLLB.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZBZL='" + model.ZBZL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",BSXLX='" + model.BSXLX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CLSXSJ='" + model.CLSXSJ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CLXXSJ='" + model.CLXXSJ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",DLY='" + model.DLY.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YCY='" + model.YCY.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",WGJYY='" + model.WGJYY.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",DPJYY='" + model.DPJYY.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",DTDPJYY='" + model.DTDPJYY.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LSJYY='" + model.LSJYY.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SQQZR='" + model.SQQZR.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",WQCZY='" + model.WQCZY.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GXRQ='" + model.GXRQ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JYXM_EX='" + model.JYXM_EX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZZS='" + model.ZZS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GLCJCLSH='" + model.GLCJCLSH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GLCHPZL='" + model.GLCHPZL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GLCHPZLDH='" + model.GLCHPZLDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LWCXWZJL='" + model.LWCXWZJL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SFSQCLC='" + model.SFSQCLC.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GLCJYXM='" + model.GLCJYXM.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LWCXWZJLDH='" + model.LWCXWZJLDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",HDZH='" + model.HDZH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",EDNJGL='" + model.EDNJGL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JZZZWZ='" + model.JZZZWZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",FWQ_ZYXZ='" + model.FWQ_ZYXZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LWLRLSH='" + model.LWLRLSH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LWLRHENF='" + model.LWLRHENF.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LTGGLX='" + model.LTGGLX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",LTGGLXDH='" + model.LTGGLXDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",QDZKZZL='" + model.QDZKZZL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",WQLSH='" + model.WQLSH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",AJLSH='" + model.AJLSH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZJLSH='" + model.ZJLSH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",MTLSH='" + model.MTLSH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZZL='" + model.ZZL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",MTCSFDJSS='" + model.MTCSFDJSS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",MTCSFDJSSDH='" + model.MTCSFDJSSDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZYWLB='" + model.ZYWLB.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZYWLBDH='" + model.ZYWLBDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JYLB_TYPE='" + model.JYLB_TYPE.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CLSSLB='" + model.CLSSLB.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CLSSLBDH='" + model.CLSSLBDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SYRSFZ='" + model.SYRSFZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZJJYRQ='" + model.ZJJYRQ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",BXZZRQ='" + model.BXZZRQ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JYYXQZ='" + model.JYYXQZ.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CLYTDH='" + model.CLYTDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",YTSXDH='" + model.YTSXDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",JYXM_LW='" + model.JYXM_LW.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",WAIT_LINE=" + model.WAIT_LINE + "";
                  strUpdateSQL += ",GCPZH='" + model.GCPZH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCLX='" + model.GCLX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCLXDH='" + model.GCLXDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",QYCMZZZL='" + model.QYCMZZZL.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",DCZS='" + model.DCZS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",XZQY='" + model.XZQY.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZCLBGD='" + model.ZCLBGD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCLBGD='" + model.GCLBGD.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCCSC='" + model.GCCSC.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCCSK='" + model.GCCSK.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCCSG='" + model.GCCSG.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCBZZXS='" + model.GCBZZXS.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",GCBZZXSDH='" + model.GCBZZXSDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZJCLLX='" + model.ZJCLLX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",ZJCLLXDH='" + model.ZJCLLXDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SFSWPC='" + model.SFSWPC.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",DLYSZH='" + model.DLYSZH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",SFSGSQC='" + model.SFSGSQC.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CLCCLX='" + model.CLCCLX.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",CLCCLXDH='" + model.CLCCLXDH.ToString().Replace("'","''") + "'";
                  strUpdateSQL += ",DLRQ='" + model.DLRQ.ToString().Replace("'","''") + "'";


               string strSql = "";
               strSql += "update VEHICLE_DISPATCH set ";
               strSql += strUpdateSQL.Substring(1);

               return strSql;

          }

          /// <summary>
          /// 修改全部数据
          /// </summary>
          public bool UpdateAll(VEHICLE_DISPATCH model)
          {
              return DbHelper.ExecuteSql(UpdateAllSQL(model));
          }

          /// <summary>
          /// 删除一条数据 SQL
          /// </summary>
          public string DeleteSQL(string strJCLSH)
          {
              string strSql = "";
              strSql += "delete from VEHICLE_DISPATCH";
              strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

              return strSql;

          }

          /// <summary>
          /// 删除一条数据
          /// </summary>
          public bool Delete(string strJCLSH)
          {
              return DbHelper.ExecuteSql(DeleteSQL(strJCLSH));
          }

          /// <summary>
          /// 删除一个集合 SQL
          /// </summary>
          public string DeleteRangeSQL(string p_strWhere)
          {
              string strSql = "";
              strSql += "delete from VEHICLE_DISPATCH";
              strSql += " where " + p_strWhere;

              return strSql;
           }

          /// <summary>
          /// 删除一个集合
          /// </summary>
          public bool DeleteRange(string p_strWhere)
          {
              return DbHelper.ExecuteSql(DeleteRangeSQL(p_strWhere));
          }

          /// <summary>
          /// 删除全部 SQL
          /// </summary>
          public string DeleteAllSQL()
          {
              string strSql = "";
              strSql += "delete from VEHICLE_DISPATCH";

              return strSql;
           }

         /// <summary>
         /// 删除全部
         /// </summary>
         public bool DeleteAll()
         {
             return DbHelper.ExecuteSql(DeleteAllSQL());
         }

          /// <summary>
         /// 得到一个对象实体
         /// </summary>
         public VEHICLE_DISPATCH GetModel(string strJCLSH)
         {
             string strSql = "";
             strSql += "select * from VEHICLE_DISPATCH";
             strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

             DataTable dtTemp = new DataTable();
             DbHelper.GetTable(strSql, ref dtTemp);

             VEHICLE_DISPATCH model = new VEHICLE_DISPATCH();

             if(dtTemp.Rows.Count>0)
             {
                 model = new VEHICLE_DISPATCH();

                 model.ID = dtTemp.Rows[0]["ID"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["ID"]);
                 model.VEHICLEID = dtTemp.Rows[0]["VEHICLEID"] == DBNull.Value ? "" : dtTemp.Rows[0]["VEHICLEID"].ToString();
                 model.JCXH = dtTemp.Rows[0]["JCXH"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["JCXH"]);
                 model.JCXHMS = dtTemp.Rows[0]["JCXHMS"] == DBNull.Value ? "" : dtTemp.Rows[0]["JCXHMS"].ToString();
                 model.SCJCXH = dtTemp.Rows[0]["SCJCXH"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["SCJCXH"]);
                 model.JCZT_STATUS = dtTemp.Rows[0]["JCZT_STATUS"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["JCZT_STATUS"]);
                 model.GW_STATUS = dtTemp.Rows[0]["GW_STATUS"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["GW_STATUS"]);
                 model.GWBH = dtTemp.Rows[0]["GWBH"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["GWBH"]);
                 model.YJGWH = dtTemp.Rows[0]["YJGWH"] == DBNull.Value ? "" : dtTemp.Rows[0]["YJGWH"].ToString();
                 model.ZDGWBH = dtTemp.Rows[0]["ZDGWBH"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["ZDGWBH"]);
                 model.JCCS = dtTemp.Rows[0]["JCCS"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["JCCS"]);
                 model.JCLSH = dtTemp.Rows[0]["JCLSH"] == DBNull.Value ? "" : dtTemp.Rows[0]["JCLSH"].ToString();
                 model.JYXM = dtTemp.Rows[0]["JYXM"] == DBNull.Value ? "" : dtTemp.Rows[0]["JYXM"].ToString();
                 model.YJXM = dtTemp.Rows[0]["YJXM"] == DBNull.Value ? "" : dtTemp.Rows[0]["YJXM"].ToString();
                 model.FJXM = dtTemp.Rows[0]["FJXM"] == DBNull.Value ? "" : dtTemp.Rows[0]["FJXM"].ToString();
                 model.JCBGDBH01 = dtTemp.Rows[0]["JCBGDBH01"] == DBNull.Value ? "" : dtTemp.Rows[0]["JCBGDBH01"].ToString();
                 model.JCBGDBH02 = dtTemp.Rows[0]["JCBGDBH02"] == DBNull.Value ? "" : dtTemp.Rows[0]["JCBGDBH02"].ToString();
                 model.HPHM = dtTemp.Rows[0]["HPHM"] == DBNull.Value ? "" : dtTemp.Rows[0]["HPHM"].ToString();
                 model.HPZL = dtTemp.Rows[0]["HPZL"] == DBNull.Value ? "" : dtTemp.Rows[0]["HPZL"].ToString();
                 model.HPZLDH = dtTemp.Rows[0]["HPZLDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["HPZLDH"].ToString();
                 model.GLCHPHM = dtTemp.Rows[0]["GLCHPHM"] == DBNull.Value ? "" : dtTemp.Rows[0]["GLCHPHM"].ToString();
                 model.CLZLDH = dtTemp.Rows[0]["CLZLDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["CLZLDH"].ToString();
                 model.VIN = dtTemp.Rows[0]["VIN"] == DBNull.Value ? "" : dtTemp.Rows[0]["VIN"].ToString();
                 model.JYLB = dtTemp.Rows[0]["JYLB"] == DBNull.Value ? "" : dtTemp.Rows[0]["JYLB"].ToString();
                 model.JYLBDH = dtTemp.Rows[0]["JYLBDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["JYLBDH"].ToString();
                 model.QDXS = dtTemp.Rows[0]["QDXS"] == DBNull.Value ? "" : dtTemp.Rows[0]["QDXS"].ToString();
                 model.QZDZ = dtTemp.Rows[0]["QZDZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["QZDZ"].ToString();
                 model.YGGSNFKT = dtTemp.Rows[0]["YGGSNFKT"] == DBNull.Value ? "" : dtTemp.Rows[0]["YGGSNFKT"].ToString();
                 model.RLLB = dtTemp.Rows[0]["RLLB"] == DBNull.Value ? "" : dtTemp.Rows[0]["RLLB"].ToString();
                 model.ZBZL = dtTemp.Rows[0]["ZBZL"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZBZL"].ToString();
                 model.BSXLX = dtTemp.Rows[0]["BSXLX"] == DBNull.Value ? "" : dtTemp.Rows[0]["BSXLX"].ToString();
                 model.CLSXSJ = dtTemp.Rows[0]["CLSXSJ"] == DBNull.Value ? "" : dtTemp.Rows[0]["CLSXSJ"].ToString();
                 model.CLXXSJ = dtTemp.Rows[0]["CLXXSJ"] == DBNull.Value ? "" : dtTemp.Rows[0]["CLXXSJ"].ToString();
                 model.DLY = dtTemp.Rows[0]["DLY"] == DBNull.Value ? "" : dtTemp.Rows[0]["DLY"].ToString();
                 model.YCY = dtTemp.Rows[0]["YCY"] == DBNull.Value ? "" : dtTemp.Rows[0]["YCY"].ToString();
                 model.WGJYY = dtTemp.Rows[0]["WGJYY"] == DBNull.Value ? "" : dtTemp.Rows[0]["WGJYY"].ToString();
                 model.DPJYY = dtTemp.Rows[0]["DPJYY"] == DBNull.Value ? "" : dtTemp.Rows[0]["DPJYY"].ToString();
                 model.DTDPJYY = dtTemp.Rows[0]["DTDPJYY"] == DBNull.Value ? "" : dtTemp.Rows[0]["DTDPJYY"].ToString();
                 model.LSJYY = dtTemp.Rows[0]["LSJYY"] == DBNull.Value ? "" : dtTemp.Rows[0]["LSJYY"].ToString();
                 model.SQQZR = dtTemp.Rows[0]["SQQZR"] == DBNull.Value ? "" : dtTemp.Rows[0]["SQQZR"].ToString();
                 model.WQCZY = dtTemp.Rows[0]["WQCZY"] == DBNull.Value ? "" : dtTemp.Rows[0]["WQCZY"].ToString();
                 model.GXRQ = dtTemp.Rows[0]["GXRQ"] == DBNull.Value ? "" : dtTemp.Rows[0]["GXRQ"].ToString();
                 model.JYXM_EX = dtTemp.Rows[0]["JYXM_EX"] == DBNull.Value ? "" : dtTemp.Rows[0]["JYXM_EX"].ToString();
                 model.ZZS = dtTemp.Rows[0]["ZZS"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZZS"].ToString();
                 model.GLCJCLSH = dtTemp.Rows[0]["GLCJCLSH"] == DBNull.Value ? "" : dtTemp.Rows[0]["GLCJCLSH"].ToString();
                 model.GLCHPZL = dtTemp.Rows[0]["GLCHPZL"] == DBNull.Value ? "" : dtTemp.Rows[0]["GLCHPZL"].ToString();
                 model.GLCHPZLDH = dtTemp.Rows[0]["GLCHPZLDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["GLCHPZLDH"].ToString();
                 model.LWCXWZJL = dtTemp.Rows[0]["LWCXWZJL"] == DBNull.Value ? "" : dtTemp.Rows[0]["LWCXWZJL"].ToString();
                 model.SFSQCLC = dtTemp.Rows[0]["SFSQCLC"] == DBNull.Value ? "" : dtTemp.Rows[0]["SFSQCLC"].ToString();
                 model.GLCJYXM = dtTemp.Rows[0]["GLCJYXM"] == DBNull.Value ? "" : dtTemp.Rows[0]["GLCJYXM"].ToString();
                 model.LWCXWZJLDH = dtTemp.Rows[0]["LWCXWZJLDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["LWCXWZJLDH"].ToString();
                 model.HDZH = dtTemp.Rows[0]["HDZH"] == DBNull.Value ? "" : dtTemp.Rows[0]["HDZH"].ToString();
                 model.EDNJGL = dtTemp.Rows[0]["EDNJGL"] == DBNull.Value ? "" : dtTemp.Rows[0]["EDNJGL"].ToString();
                 model.JZZZWZ = dtTemp.Rows[0]["JZZZWZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["JZZZWZ"].ToString();
                 model.FWQ_ZYXZ = dtTemp.Rows[0]["FWQ_ZYXZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["FWQ_ZYXZ"].ToString();
                 model.LWLRLSH = dtTemp.Rows[0]["LWLRLSH"] == DBNull.Value ? "" : dtTemp.Rows[0]["LWLRLSH"].ToString();
                 model.LWLRHENF = dtTemp.Rows[0]["LWLRHENF"] == DBNull.Value ? "" : dtTemp.Rows[0]["LWLRHENF"].ToString();
                 model.LTGGLX = dtTemp.Rows[0]["LTGGLX"] == DBNull.Value ? "" : dtTemp.Rows[0]["LTGGLX"].ToString();
                 model.LTGGLXDH = dtTemp.Rows[0]["LTGGLXDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["LTGGLXDH"].ToString();
                 model.QDZKZZL = dtTemp.Rows[0]["QDZKZZL"] == DBNull.Value ? "" : dtTemp.Rows[0]["QDZKZZL"].ToString();
                 model.WQLSH = dtTemp.Rows[0]["WQLSH"] == DBNull.Value ? "" : dtTemp.Rows[0]["WQLSH"].ToString();
                 model.AJLSH = dtTemp.Rows[0]["AJLSH"] == DBNull.Value ? "" : dtTemp.Rows[0]["AJLSH"].ToString();
                 model.ZJLSH = dtTemp.Rows[0]["ZJLSH"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZJLSH"].ToString();
                 model.MTLSH = dtTemp.Rows[0]["MTLSH"] == DBNull.Value ? "" : dtTemp.Rows[0]["MTLSH"].ToString();
                 model.ZZL = dtTemp.Rows[0]["ZZL"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZZL"].ToString();
                 model.MTCSFDJSS = dtTemp.Rows[0]["MTCSFDJSS"] == DBNull.Value ? "" : dtTemp.Rows[0]["MTCSFDJSS"].ToString();
                 model.MTCSFDJSSDH = dtTemp.Rows[0]["MTCSFDJSSDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["MTCSFDJSSDH"].ToString();
                 model.ZYWLB = dtTemp.Rows[0]["ZYWLB"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZYWLB"].ToString();
                 model.ZYWLBDH = dtTemp.Rows[0]["ZYWLBDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZYWLBDH"].ToString();
                 model.JYLB_TYPE = dtTemp.Rows[0]["JYLB_TYPE"] == DBNull.Value ? "" : dtTemp.Rows[0]["JYLB_TYPE"].ToString();
                 model.CLSSLB = dtTemp.Rows[0]["CLSSLB"] == DBNull.Value ? "" : dtTemp.Rows[0]["CLSSLB"].ToString();
                 model.CLSSLBDH = dtTemp.Rows[0]["CLSSLBDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["CLSSLBDH"].ToString();
                 model.SYRSFZ = dtTemp.Rows[0]["SYRSFZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["SYRSFZ"].ToString();
                 model.ZJJYRQ = dtTemp.Rows[0]["ZJJYRQ"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZJJYRQ"].ToString();
                 model.BXZZRQ = dtTemp.Rows[0]["BXZZRQ"] == DBNull.Value ? "" : dtTemp.Rows[0]["BXZZRQ"].ToString();
                 model.JYYXQZ = dtTemp.Rows[0]["JYYXQZ"] == DBNull.Value ? "" : dtTemp.Rows[0]["JYYXQZ"].ToString();
                 model.CLYTDH = dtTemp.Rows[0]["CLYTDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["CLYTDH"].ToString();
                 model.YTSXDH = dtTemp.Rows[0]["YTSXDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["YTSXDH"].ToString();
                 model.JYXM_LW = dtTemp.Rows[0]["JYXM_LW"] == DBNull.Value ? "" : dtTemp.Rows[0]["JYXM_LW"].ToString();
                 model.WAIT_LINE = dtTemp.Rows[0]["WAIT_LINE"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[0]["WAIT_LINE"]);
                 model.GCPZH = dtTemp.Rows[0]["GCPZH"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCPZH"].ToString();
                 model.GCLX = dtTemp.Rows[0]["GCLX"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCLX"].ToString();
                 model.GCLXDH = dtTemp.Rows[0]["GCLXDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCLXDH"].ToString();
                 model.QYCMZZZL = dtTemp.Rows[0]["QYCMZZZL"] == DBNull.Value ? "" : dtTemp.Rows[0]["QYCMZZZL"].ToString();
                 model.DCZS = dtTemp.Rows[0]["DCZS"] == DBNull.Value ? "" : dtTemp.Rows[0]["DCZS"].ToString();
                 model.XZQY = dtTemp.Rows[0]["XZQY"] == DBNull.Value ? "" : dtTemp.Rows[0]["XZQY"].ToString();
                 model.ZCLBGD = dtTemp.Rows[0]["ZCLBGD"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZCLBGD"].ToString();
                 model.GCLBGD = dtTemp.Rows[0]["GCLBGD"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCLBGD"].ToString();
                 model.GCCSC = dtTemp.Rows[0]["GCCSC"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCCSC"].ToString();
                 model.GCCSK = dtTemp.Rows[0]["GCCSK"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCCSK"].ToString();
                 model.GCCSG = dtTemp.Rows[0]["GCCSG"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCCSG"].ToString();
                 model.GCBZZXS = dtTemp.Rows[0]["GCBZZXS"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCBZZXS"].ToString();
                 model.GCBZZXSDH = dtTemp.Rows[0]["GCBZZXSDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["GCBZZXSDH"].ToString();
                 model.ZJCLLX = dtTemp.Rows[0]["ZJCLLX"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZJCLLX"].ToString();
                 model.ZJCLLXDH = dtTemp.Rows[0]["ZJCLLXDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["ZJCLLXDH"].ToString();
                 model.SFSWPC = dtTemp.Rows[0]["SFSWPC"] == DBNull.Value ? "" : dtTemp.Rows[0]["SFSWPC"].ToString();
                 model.DLYSZH = dtTemp.Rows[0]["DLYSZH"] == DBNull.Value ? "" : dtTemp.Rows[0]["DLYSZH"].ToString();
                 model.SFSGSQC = dtTemp.Rows[0]["SFSGSQC"] == DBNull.Value ? "" : dtTemp.Rows[0]["SFSGSQC"].ToString();
                 model.CLCCLX = dtTemp.Rows[0]["CLCCLX"] == DBNull.Value ? "" : dtTemp.Rows[0]["CLCCLX"].ToString();
                 model.CLCCLXDH = dtTemp.Rows[0]["CLCCLXDH"] == DBNull.Value ? "" : dtTemp.Rows[0]["CLCCLXDH"].ToString();
                 model.DLRQ = dtTemp.Rows[0]["DLRQ"] == DBNull.Value ? "" : dtTemp.Rows[0]["DLRQ"].ToString();
             }

             dtTemp.Dispose();

             return model;
         }

         /// <summary>
         /// 得到一个对象实体
         /// </summary>
         public void GetModel(ref DataTable p_dtData, string strJCLSH)
         {
             p_dtData.Clear();

             string strSql = "";
             strSql += "select * from VEHICLE_DISPATCH";
             strSql += " where ";
               strSql += " JCLSH='"+ strJCLSH +"'";

              DbHelper.GetTable(strSql, ref p_dtData);
         }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public VEHICLE_DISPATCH[] GetModelList(string p_strWhere, string p_strOrder, int p_intPageNumber, int p_intPageSize)
      {
          int m_intPageNumber = p_intPageNumber;
          int m_intPageCount = GetPageCount(p_strWhere, p_intPageSize);

          if((m_intPageNumber < 1) || (m_intPageNumber == 0))
          {
               m_intPageNumber = 1;
          }

          if(m_intPageNumber == -1)
          {
               m_intPageNumber = m_intPageCount;
          }

          if(m_intPageNumber > m_intPageCount)
          {
               m_intPageNumber = m_intPageCount;
          }

          string strSql = "";
          strSql += "select * from VEHICLE_DISPATCH";
          if(p_strWhere.Trim().Length > 0)
          {
               strSql += " where " + p_strWhere;
          }
          if(p_strOrder.Trim().Length > 0)
          {
               strSql += " order by " + p_strOrder;
          }

          DataTable dtTemp = new DataTable();

          if(p_intPageSize > 0)
          {
               DbHelper.GetTable(strSql, ref dtTemp, (m_intPageNumber-1)*p_intPageSize, p_intPageSize);
          }
          else
          {
               DbHelper.GetTable(strSql, ref dtTemp);
          }

          VEHICLE_DISPATCH[] arrModel=new VEHICLE_DISPATCH[dtTemp.Rows.Count];

          for(int N=0;N<dtTemp.Rows.Count;N++)
          {
               arrModel[N] = new VEHICLE_DISPATCH();

                 arrModel[N].ID = dtTemp.Rows[N]["ID"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["ID"]);
                 arrModel[N].VEHICLEID = dtTemp.Rows[N]["VEHICLEID"] == DBNull.Value ? "" : dtTemp.Rows[N]["VEHICLEID"].ToString();
                 arrModel[N].JCXH = dtTemp.Rows[N]["JCXH"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["JCXH"]);
                 arrModel[N].JCXHMS = dtTemp.Rows[N]["JCXHMS"] == DBNull.Value ? "" : dtTemp.Rows[N]["JCXHMS"].ToString();
                 arrModel[N].SCJCXH = dtTemp.Rows[N]["SCJCXH"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["SCJCXH"]);
                 arrModel[N].JCZT_STATUS = dtTemp.Rows[N]["JCZT_STATUS"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["JCZT_STATUS"]);
                 arrModel[N].GW_STATUS = dtTemp.Rows[N]["GW_STATUS"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["GW_STATUS"]);
                 arrModel[N].GWBH = dtTemp.Rows[N]["GWBH"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["GWBH"]);
                 arrModel[N].YJGWH = dtTemp.Rows[N]["YJGWH"] == DBNull.Value ? "" : dtTemp.Rows[N]["YJGWH"].ToString();
                 arrModel[N].ZDGWBH = dtTemp.Rows[N]["ZDGWBH"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["ZDGWBH"]);
                 arrModel[N].JCCS = dtTemp.Rows[N]["JCCS"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["JCCS"]);
                 arrModel[N].JCLSH = dtTemp.Rows[N]["JCLSH"] == DBNull.Value ? "" : dtTemp.Rows[N]["JCLSH"].ToString();
                 arrModel[N].JYXM = dtTemp.Rows[N]["JYXM"] == DBNull.Value ? "" : dtTemp.Rows[N]["JYXM"].ToString();
                 arrModel[N].YJXM = dtTemp.Rows[N]["YJXM"] == DBNull.Value ? "" : dtTemp.Rows[N]["YJXM"].ToString();
                 arrModel[N].FJXM = dtTemp.Rows[N]["FJXM"] == DBNull.Value ? "" : dtTemp.Rows[N]["FJXM"].ToString();
                 arrModel[N].JCBGDBH01 = dtTemp.Rows[N]["JCBGDBH01"] == DBNull.Value ? "" : dtTemp.Rows[N]["JCBGDBH01"].ToString();
                 arrModel[N].JCBGDBH02 = dtTemp.Rows[N]["JCBGDBH02"] == DBNull.Value ? "" : dtTemp.Rows[N]["JCBGDBH02"].ToString();
                 arrModel[N].HPHM = dtTemp.Rows[N]["HPHM"] == DBNull.Value ? "" : dtTemp.Rows[N]["HPHM"].ToString();
                 arrModel[N].HPZL = dtTemp.Rows[N]["HPZL"] == DBNull.Value ? "" : dtTemp.Rows[N]["HPZL"].ToString();
                 arrModel[N].HPZLDH = dtTemp.Rows[N]["HPZLDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["HPZLDH"].ToString();
                 arrModel[N].GLCHPHM = dtTemp.Rows[N]["GLCHPHM"] == DBNull.Value ? "" : dtTemp.Rows[N]["GLCHPHM"].ToString();
                 arrModel[N].CLZLDH = dtTemp.Rows[N]["CLZLDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["CLZLDH"].ToString();
                 arrModel[N].VIN = dtTemp.Rows[N]["VIN"] == DBNull.Value ? "" : dtTemp.Rows[N]["VIN"].ToString();
                 arrModel[N].JYLB = dtTemp.Rows[N]["JYLB"] == DBNull.Value ? "" : dtTemp.Rows[N]["JYLB"].ToString();
                 arrModel[N].JYLBDH = dtTemp.Rows[N]["JYLBDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["JYLBDH"].ToString();
                 arrModel[N].QDXS = dtTemp.Rows[N]["QDXS"] == DBNull.Value ? "" : dtTemp.Rows[N]["QDXS"].ToString();
                 arrModel[N].QZDZ = dtTemp.Rows[N]["QZDZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["QZDZ"].ToString();
                 arrModel[N].YGGSNFKT = dtTemp.Rows[N]["YGGSNFKT"] == DBNull.Value ? "" : dtTemp.Rows[N]["YGGSNFKT"].ToString();
                 arrModel[N].RLLB = dtTemp.Rows[N]["RLLB"] == DBNull.Value ? "" : dtTemp.Rows[N]["RLLB"].ToString();
                 arrModel[N].ZBZL = dtTemp.Rows[N]["ZBZL"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZBZL"].ToString();
                 arrModel[N].BSXLX = dtTemp.Rows[N]["BSXLX"] == DBNull.Value ? "" : dtTemp.Rows[N]["BSXLX"].ToString();
                 arrModel[N].CLSXSJ = dtTemp.Rows[N]["CLSXSJ"] == DBNull.Value ? "" : dtTemp.Rows[N]["CLSXSJ"].ToString();
                 arrModel[N].CLXXSJ = dtTemp.Rows[N]["CLXXSJ"] == DBNull.Value ? "" : dtTemp.Rows[N]["CLXXSJ"].ToString();
                 arrModel[N].DLY = dtTemp.Rows[N]["DLY"] == DBNull.Value ? "" : dtTemp.Rows[N]["DLY"].ToString();
                 arrModel[N].YCY = dtTemp.Rows[N]["YCY"] == DBNull.Value ? "" : dtTemp.Rows[N]["YCY"].ToString();
                 arrModel[N].WGJYY = dtTemp.Rows[N]["WGJYY"] == DBNull.Value ? "" : dtTemp.Rows[N]["WGJYY"].ToString();
                 arrModel[N].DPJYY = dtTemp.Rows[N]["DPJYY"] == DBNull.Value ? "" : dtTemp.Rows[N]["DPJYY"].ToString();
                 arrModel[N].DTDPJYY = dtTemp.Rows[N]["DTDPJYY"] == DBNull.Value ? "" : dtTemp.Rows[N]["DTDPJYY"].ToString();
                 arrModel[N].LSJYY = dtTemp.Rows[N]["LSJYY"] == DBNull.Value ? "" : dtTemp.Rows[N]["LSJYY"].ToString();
                 arrModel[N].SQQZR = dtTemp.Rows[N]["SQQZR"] == DBNull.Value ? "" : dtTemp.Rows[N]["SQQZR"].ToString();
                 arrModel[N].WQCZY = dtTemp.Rows[N]["WQCZY"] == DBNull.Value ? "" : dtTemp.Rows[N]["WQCZY"].ToString();
                 arrModel[N].GXRQ = dtTemp.Rows[N]["GXRQ"] == DBNull.Value ? "" : dtTemp.Rows[N]["GXRQ"].ToString();
                 arrModel[N].JYXM_EX = dtTemp.Rows[N]["JYXM_EX"] == DBNull.Value ? "" : dtTemp.Rows[N]["JYXM_EX"].ToString();
                 arrModel[N].ZZS = dtTemp.Rows[N]["ZZS"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZZS"].ToString();
                 arrModel[N].GLCJCLSH = dtTemp.Rows[N]["GLCJCLSH"] == DBNull.Value ? "" : dtTemp.Rows[N]["GLCJCLSH"].ToString();
                 arrModel[N].GLCHPZL = dtTemp.Rows[N]["GLCHPZL"] == DBNull.Value ? "" : dtTemp.Rows[N]["GLCHPZL"].ToString();
                 arrModel[N].GLCHPZLDH = dtTemp.Rows[N]["GLCHPZLDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["GLCHPZLDH"].ToString();
                 arrModel[N].LWCXWZJL = dtTemp.Rows[N]["LWCXWZJL"] == DBNull.Value ? "" : dtTemp.Rows[N]["LWCXWZJL"].ToString();
                 arrModel[N].SFSQCLC = dtTemp.Rows[N]["SFSQCLC"] == DBNull.Value ? "" : dtTemp.Rows[N]["SFSQCLC"].ToString();
                 arrModel[N].GLCJYXM = dtTemp.Rows[N]["GLCJYXM"] == DBNull.Value ? "" : dtTemp.Rows[N]["GLCJYXM"].ToString();
                 arrModel[N].LWCXWZJLDH = dtTemp.Rows[N]["LWCXWZJLDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["LWCXWZJLDH"].ToString();
                 arrModel[N].HDZH = dtTemp.Rows[N]["HDZH"] == DBNull.Value ? "" : dtTemp.Rows[N]["HDZH"].ToString();
                 arrModel[N].EDNJGL = dtTemp.Rows[N]["EDNJGL"] == DBNull.Value ? "" : dtTemp.Rows[N]["EDNJGL"].ToString();
                 arrModel[N].JZZZWZ = dtTemp.Rows[N]["JZZZWZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["JZZZWZ"].ToString();
                 arrModel[N].FWQ_ZYXZ = dtTemp.Rows[N]["FWQ_ZYXZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["FWQ_ZYXZ"].ToString();
                 arrModel[N].LWLRLSH = dtTemp.Rows[N]["LWLRLSH"] == DBNull.Value ? "" : dtTemp.Rows[N]["LWLRLSH"].ToString();
                 arrModel[N].LWLRHENF = dtTemp.Rows[N]["LWLRHENF"] == DBNull.Value ? "" : dtTemp.Rows[N]["LWLRHENF"].ToString();
                 arrModel[N].LTGGLX = dtTemp.Rows[N]["LTGGLX"] == DBNull.Value ? "" : dtTemp.Rows[N]["LTGGLX"].ToString();
                 arrModel[N].LTGGLXDH = dtTemp.Rows[N]["LTGGLXDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["LTGGLXDH"].ToString();
                 arrModel[N].QDZKZZL = dtTemp.Rows[N]["QDZKZZL"] == DBNull.Value ? "" : dtTemp.Rows[N]["QDZKZZL"].ToString();
                 arrModel[N].WQLSH = dtTemp.Rows[N]["WQLSH"] == DBNull.Value ? "" : dtTemp.Rows[N]["WQLSH"].ToString();
                 arrModel[N].AJLSH = dtTemp.Rows[N]["AJLSH"] == DBNull.Value ? "" : dtTemp.Rows[N]["AJLSH"].ToString();
                 arrModel[N].ZJLSH = dtTemp.Rows[N]["ZJLSH"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZJLSH"].ToString();
                 arrModel[N].MTLSH = dtTemp.Rows[N]["MTLSH"] == DBNull.Value ? "" : dtTemp.Rows[N]["MTLSH"].ToString();
                 arrModel[N].ZZL = dtTemp.Rows[N]["ZZL"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZZL"].ToString();
                 arrModel[N].MTCSFDJSS = dtTemp.Rows[N]["MTCSFDJSS"] == DBNull.Value ? "" : dtTemp.Rows[N]["MTCSFDJSS"].ToString();
                 arrModel[N].MTCSFDJSSDH = dtTemp.Rows[N]["MTCSFDJSSDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["MTCSFDJSSDH"].ToString();
                 arrModel[N].ZYWLB = dtTemp.Rows[N]["ZYWLB"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZYWLB"].ToString();
                 arrModel[N].ZYWLBDH = dtTemp.Rows[N]["ZYWLBDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZYWLBDH"].ToString();
                 arrModel[N].JYLB_TYPE = dtTemp.Rows[N]["JYLB_TYPE"] == DBNull.Value ? "" : dtTemp.Rows[N]["JYLB_TYPE"].ToString();
                 arrModel[N].CLSSLB = dtTemp.Rows[N]["CLSSLB"] == DBNull.Value ? "" : dtTemp.Rows[N]["CLSSLB"].ToString();
                 arrModel[N].CLSSLBDH = dtTemp.Rows[N]["CLSSLBDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["CLSSLBDH"].ToString();
                 arrModel[N].SYRSFZ = dtTemp.Rows[N]["SYRSFZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["SYRSFZ"].ToString();
                 arrModel[N].ZJJYRQ = dtTemp.Rows[N]["ZJJYRQ"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZJJYRQ"].ToString();
                 arrModel[N].BXZZRQ = dtTemp.Rows[N]["BXZZRQ"] == DBNull.Value ? "" : dtTemp.Rows[N]["BXZZRQ"].ToString();
                 arrModel[N].JYYXQZ = dtTemp.Rows[N]["JYYXQZ"] == DBNull.Value ? "" : dtTemp.Rows[N]["JYYXQZ"].ToString();
                 arrModel[N].CLYTDH = dtTemp.Rows[N]["CLYTDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["CLYTDH"].ToString();
                 arrModel[N].YTSXDH = dtTemp.Rows[N]["YTSXDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["YTSXDH"].ToString();
                 arrModel[N].JYXM_LW = dtTemp.Rows[N]["JYXM_LW"] == DBNull.Value ? "" : dtTemp.Rows[N]["JYXM_LW"].ToString();
                 arrModel[N].WAIT_LINE = dtTemp.Rows[N]["WAIT_LINE"] == DBNull.Value ? 0 : Convert.ToInt32(dtTemp.Rows[N]["WAIT_LINE"]);
                 arrModel[N].GCPZH = dtTemp.Rows[N]["GCPZH"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCPZH"].ToString();
                 arrModel[N].GCLX = dtTemp.Rows[N]["GCLX"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCLX"].ToString();
                 arrModel[N].GCLXDH = dtTemp.Rows[N]["GCLXDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCLXDH"].ToString();
                 arrModel[N].QYCMZZZL = dtTemp.Rows[N]["QYCMZZZL"] == DBNull.Value ? "" : dtTemp.Rows[N]["QYCMZZZL"].ToString();
                 arrModel[N].DCZS = dtTemp.Rows[N]["DCZS"] == DBNull.Value ? "" : dtTemp.Rows[N]["DCZS"].ToString();
                 arrModel[N].XZQY = dtTemp.Rows[N]["XZQY"] == DBNull.Value ? "" : dtTemp.Rows[N]["XZQY"].ToString();
                 arrModel[N].ZCLBGD = dtTemp.Rows[N]["ZCLBGD"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZCLBGD"].ToString();
                 arrModel[N].GCLBGD = dtTemp.Rows[N]["GCLBGD"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCLBGD"].ToString();
                 arrModel[N].GCCSC = dtTemp.Rows[N]["GCCSC"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCCSC"].ToString();
                 arrModel[N].GCCSK = dtTemp.Rows[N]["GCCSK"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCCSK"].ToString();
                 arrModel[N].GCCSG = dtTemp.Rows[N]["GCCSG"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCCSG"].ToString();
                 arrModel[N].GCBZZXS = dtTemp.Rows[N]["GCBZZXS"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCBZZXS"].ToString();
                 arrModel[N].GCBZZXSDH = dtTemp.Rows[N]["GCBZZXSDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["GCBZZXSDH"].ToString();
                 arrModel[N].ZJCLLX = dtTemp.Rows[N]["ZJCLLX"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZJCLLX"].ToString();
                 arrModel[N].ZJCLLXDH = dtTemp.Rows[N]["ZJCLLXDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["ZJCLLXDH"].ToString();
                 arrModel[N].SFSWPC = dtTemp.Rows[N]["SFSWPC"] == DBNull.Value ? "" : dtTemp.Rows[N]["SFSWPC"].ToString();
                 arrModel[N].DLYSZH = dtTemp.Rows[N]["DLYSZH"] == DBNull.Value ? "" : dtTemp.Rows[N]["DLYSZH"].ToString();
                 arrModel[N].SFSGSQC = dtTemp.Rows[N]["SFSGSQC"] == DBNull.Value ? "" : dtTemp.Rows[N]["SFSGSQC"].ToString();
                 arrModel[N].CLCCLX = dtTemp.Rows[N]["CLCCLX"] == DBNull.Value ? "" : dtTemp.Rows[N]["CLCCLX"].ToString();
                 arrModel[N].CLCCLXDH = dtTemp.Rows[N]["CLCCLXDH"] == DBNull.Value ? "" : dtTemp.Rows[N]["CLCCLXDH"].ToString();
                 arrModel[N].DLRQ = dtTemp.Rows[N]["DLRQ"] == DBNull.Value ? "" : dtTemp.Rows[N]["DLRQ"].ToString();
          }

          dtTemp.Dispose();

          return arrModel;
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public VEHICLE_DISPATCH[] GetModelList(string p_strWhere)
      {
          return GetModelList(p_strWhere, "", -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public VEHICLE_DISPATCH[] GetModelList(string p_strWhere, string p_strOrder)
      {
          return GetModelList(p_strWhere, p_strOrder, -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public VEHICLE_DISPATCH[] GetModelList(int p_intPageNumber, int p_intPageSize)
      {
          return GetModelList("", "", p_intPageNumber, p_intPageSize);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public VEHICLE_DISPATCH[] GetModelList(string p_strWhere, int p_intPageNumber, int p_intPageSize)
      {
          return GetModelList(p_strWhere, "", p_intPageNumber, p_intPageSize);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public VEHICLE_DISPATCH[] GetModelList()
      {
          return GetModelList("", "", -1, -1);
      }

      /// <summary>
      /// 得到对象集合
      /// </summary>
      public void GetModelList(ref DataTable p_dtData, string p_strWhere, string p_strOrder, int p_intPageNumber, int p_intPageSize)
      {
          p_dtData.Clear();

          int m_intPageNumber = p_intPageNumber;
          int m_intPageCount = GetPageCount(p_strWhere, p_intPageSize);

          if((m_intPageNumber < 1) || (m_intPageNumber == 0))
          {
              m_intPageNumber = 1;
          }

          if(m_intPageNumber == -1)
          {
              m_intPageNumber = m_intPageCount;
          }

          if(m_intPageNumber > m_intPageCount)
          {
              m_intPageNumber = m_intPageCount;
          }

          string strSql = "";
          strSql += "select * from VEHICLE_DISPATCH";
          if(p_strWhere.Trim().Length > 0)
          {
              strSql += " where " + p_strWhere;
          }
          if(p_strOrder.Trim().Length > 0)
          {
              strSql += " order by " + p_strOrder;
          }

          if(p_intPageSize > 0)
          {
              DbHelper.GetTable(strSql, ref p_dtData, (m_intPageNumber-1)*p_intPageSize, p_intPageSize);
          }
          else
          {
              DbHelper.GetTable(strSql, ref p_dtData);
          }
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere)
       {
           GetModelList(ref p_dtData, p_strWhere, "", -1, -1);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere, string p_strOrder)
       {
           GetModelList(ref p_dtData, p_strWhere, p_strOrder, -1, -1);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, int p_intPageNumber, int p_intPageSize)
       {
           GetModelList(ref p_dtData, "", "", p_intPageNumber, p_intPageSize);
       }

       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData, string p_strWhere, int p_intPageNumber, int p_intPageSize)
       {
           GetModelList(ref p_dtData, p_strWhere, "", p_intPageNumber, p_intPageSize);
       }
       /// <summary>
       /// 得到对象集合
       /// </summary>
       public void GetModelList(ref DataTable p_dtData)
       {
           GetModelList(ref p_dtData, "", "", -1, -1);
       }
   }
}
